﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Zero.UControl.Base.Models;

namespace Zero.UControl.Component
{
    public class FileItemTemplateSelector : DataTemplateSelector
    {
        public DataTemplate FileTemplate { get; set; }
        public DataTemplate UploadBoxTemplate { get; set; }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is FileItem data)
            {
                return FileTemplate;
            }
            else if (item is UploadBoxItem uploadBoxItem)
            {
                return UploadBoxTemplate;
            }
            return null;
        }
    }
}
